import re
from urllib import request
import requests
url =r"https://www.sanchuangedu.cn/"
#构造请求
req=request.Request(url)
#获得响应
response=request.urlopen(req).read().decode()

print(response)

url1="https://www.sanchuangedu.cn/"

jpg1=re.findall(r"(?<=image:url\()\S+\.jpg",response)
jpg2=re.findall(r"(?<=\<img src=\")\S+\.jpg",response)
jpg3=re.findall(r"(?<=\<img src=\")\S+\.png",response)

jpg=jpg1+jpg2+jpg3

j=0
for i in jpg:
    j+=1
    res=requests.get(url1+i)
    pic=res.content
    photo=open(rf'C:\Users\liuqingtian\Desktop\文件储物箱1\爬虫\第{j}张.jpg','wb')
    photo.write(pic)
    photo.close()
print("爬取成功！！！")